#include "keyboarddialog.h"
#include "ui_keyboarddialog.h"
#include <QDebug>
#include <QMouseEvent>

keyboardDialog::keyboardDialog(QLineEdit *lineedit, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::keyboardDialog),
    m_lineEdit(lineedit)
{
    ui->setupUi(this);
    Qt::WindowFlags flags = this->windowFlags();
    this->setWindowFlags(flags | Qt::FramelessWindowHint| Qt::WindowStaysOnTopHint);
    m_shift_enable=false;
    this->setMouseTracking(false);
    setNormalStyle();
    strContent=m_lineEdit->text();
}

keyboardDialog::~keyboardDialog()
{
    delete ui;
}

void keyboardDialog::setShiftStyle()
{
#if 0
    ui->pushButton_pie->setText("~");
    ui->pushButton_num1->setText("!");
    ui->pushButton_num2->setText("@");
    ui->pushButton_num3->setText("#");
    ui->pushButton_num4->setText("$");
    ui->pushButton_num5->setText("%");
    ui->pushButton_num6->setText("^");
    ui->pushButton_num7->setText("&&");
    ui->pushButton_num8->setText("*");
    ui->pushButton_num9_L_parenthesis->setText("(");
    ui->pushButton_num0_R_parenthesis->setText(")");
    ui->pushButton_henggang->setText("_");
    ui->pushButton_denghao->setText("+");
    ui->pushButton_q->setText("Q");
    ui->pushButton_w->setText("W");
    ui->pushButton_e->setText("E");
    ui->pushButton_r->setText("R");
    ui->pushButton_t->setText("T");
    ui->pushButton_y->setText("Y");
    ui->pushButton_u->setText("U");
    ui->pushButton_i->setText("I");
    ui->pushButton_o->setText("O");
    ui->pushButton_p->setText("P");
    ui->pushButton_L_brackets->setText("{");
    ui->pushButton_R_brackets->setText("}");
    ui->pushButton_slash->setText("|");
    ui->pushButton_a->setText("A");
    ui->pushButton_s->setText("S");
    ui->pushButton_d->setText("D");
    ui->pushButton_f->setText("F");
    ui->pushButton_g->setText("G");
    ui->pushButton_h->setText("H");
    ui->pushButton_j->setText("J");
    ui->pushButton_k->setText("K");
    ui->pushButton_l->setText("L");
    ui->pushButton_colon->setText(":");
    ui->pushButton_quotation->setText("\"");
    ui->pushButton_z->setText("Z");
    ui->pushButton_x->setText("X");
    ui->pushButton_c->setText("C");
    ui->pushButton_v->setText("V");
    ui->pushButton_b->setText("B");
    ui->pushButton_n->setText("N");
    ui->pushButton_m->setText("M");
    ui->pushButton_comma_L_quotes->setText("<");
    ui->pushButton_dot_R_quotes->setText(">");
    ui->pushButton_back_slash->setText("?");
#endif

    ui->pushButton_pie->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/pie.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num1->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/1.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num2->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/2.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num3->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/3.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num4->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/4.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num5->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/5.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num6->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/6.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num7->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/7.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num8->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/8.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num9_L_parenthesis->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/9.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num0_R_parenthesis->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/0.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_henggang->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/hengxian.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_denghao->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/denghao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_q->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/Q.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_w->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/W.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_e->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/E.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_r->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/R.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_t->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/T.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_y->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/Y.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_u->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/U.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_i->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/I.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_o->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/O.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_p->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/P.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_L_brackets->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/l_kuohao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_R_brackets->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/r_kuohao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_slash->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/fanxiexian.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_a->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/A.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_s->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/S.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_d->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/D.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_f->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/F.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_g->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/G.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_h->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/H.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_j->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/J.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_k->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/K.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_l->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/L.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_colon->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/maohao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_quotation->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/yinhao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_z->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/Z.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_x->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/X.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_c->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/C.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_v->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/V.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_b->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/B.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_n->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/N.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_m->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/M.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_comma_L_quotes->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/douhao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_dot_R_quotes->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/dot.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_back_slash->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/xiexian.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_shift->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/capslock.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_space->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/space.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_space->setSizeIncrement(418,40);
}

void keyboardDialog::setNormalStyle()
{
#if 0
    ui->pushButton_pie->setText("`");
    ui->pushButton_num1->setText("1");
    ui->pushButton_num2->setText("2");
    ui->pushButton_num3->setText("3");
    ui->pushButton_num4->setText("4");
    ui->pushButton_num5->setText("5");
    ui->pushButton_num6->setText("6");
    ui->pushButton_num7->setText("7");
    ui->pushButton_num8->setText("8");
    ui->pushButton_num9_L_parenthesis->setText("9");
    ui->pushButton_num0_R_parenthesis->setText("0");
    ui->pushButton_henggang->setText("-");
    ui->pushButton_denghao->setText("=");
    ui->pushButton_q->setText("q");
    ui->pushButton_w->setText("w");
    ui->pushButton_e->setText("e");
    ui->pushButton_r->setText("r");
    ui->pushButton_t->setText("t");
    ui->pushButton_y->setText("y");
    ui->pushButton_u->setText("u");
    ui->pushButton_i->setText("i");
    ui->pushButton_o->setText("o");
    ui->pushButton_p->setText("p");
    ui->pushButton_L_brackets->setText("[");
    ui->pushButton_R_brackets->setText("]");
    ui->pushButton_slash->setText("\\");
    ui->pushButton_a->setText("a");
    ui->pushButton_s->setText("s");
    ui->pushButton_d->setText("d");
    ui->pushButton_f->setText("f");
    ui->pushButton_g->setText("g");
    ui->pushButton_h->setText("h");
    ui->pushButton_j->setText("j");
    ui->pushButton_k->setText("k");
    ui->pushButton_l->setText("l");
    ui->pushButton_colon->setText(";");
    ui->pushButton_quotation->setText("'");
    ui->pushButton_z->setText("z");
    ui->pushButton_x->setText("x");
    ui->pushButton_c->setText("c");
    ui->pushButton_v->setText("v");
    ui->pushButton_b->setText("b");
    ui->pushButton_n->setText("n");
    ui->pushButton_m->setText("m");
    ui->pushButton_comma_L_quotes->setText(",");
    ui->pushButton_dot_R_quotes->setText(".");
    ui->pushButton_back_slash->setText("/");
#endif
    ui->pushButton_pie->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/pie.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num1->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/1.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num2->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/2.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num3->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/3.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num4->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/4.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num5->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/5.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num6->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/6.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num7->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/7.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num8->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/8.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num9_L_parenthesis->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/9.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_num0_R_parenthesis->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/0.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_henggang->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/hengxian.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_denghao->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/denghao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_q->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/q.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_w->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/w.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_e->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/e.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_r->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/r.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_t->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/t.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_y->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/y.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_u->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/u.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_i->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/i.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_o->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/o.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_p->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/p.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_L_brackets->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/l_kuohao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_R_brackets->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/r_kuohao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_slash->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/fanxiexian.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_a->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/a.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_s->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/s.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_d->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/d.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_f->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/f.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_g->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/g.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_h->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/h.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_j->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/j.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_k->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/k.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_l->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/l.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_colon->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/maohao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_quotation->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/yinhao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_z->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/z.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_x->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/x.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_c->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/c.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_v->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/v.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_b->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/b.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_n->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/n.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_m->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/m.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_comma_L_quotes->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/douhao.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_dot_R_quotes->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/dot.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_back_slash->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/xiegang.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_shift->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/lower/capslock.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_space->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/space.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_enter->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/enter.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_back->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/back.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_right->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/right.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_left->setStyleSheet("QPushButton{image: url(:/new/prefix1/icons/upper/left.png);border-radius:2px;} QPushButton:hover{border-radius:2px;} QPushButton:pressed{padding-left:2px;padding-top:2px;border-radius:5px;};");
    ui->pushButton_space->setSizeIncrement(418,40);
}

void keyboardDialog::setLineEdit(QLineEdit *lineedit)
{
    m_lineEdit=lineedit;
    m_shift_enable=false;
    setNormalStyle();
    strContent=m_lineEdit->text();

}

void keyboardDialog::mousePressEvent(QMouseEvent *event)
{
    if(event->button()==Qt::LeftButton)
    {
        dragPosition = event->globalPos() - frameGeometry().topLeft();
        event->accept();
    }

}

void keyboardDialog::mouseMoveEvent(QMouseEvent *event)
{
    if (event->buttons() == Qt::LeftButton) //当满足鼠标左键被点击时。
    {
        move(event->globalPos() - dragPosition);//移动窗口
        event->accept();
    }
}

void keyboardDialog::on_pushButton_shift_clicked()
{
    if(m_shift_enable)
        m_shift_enable=false;
    else
        m_shift_enable=true;
    if(m_shift_enable)
    {
        //change a A
        setShiftStyle();
    }
    else
    {
        setNormalStyle();
    }
}


void keyboardDialog::on_pushButton_num1_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'!');
    else
        strContent.insert(idx,'1');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();

}


void keyboardDialog::on_pushButton_num2_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'@');
    else
        strContent.insert(idx,'2');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num3_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'#');
    else
        strContent.insert(idx,'3');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num4_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'$');
    else
        strContent.insert(idx,'4');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num5_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'%');
    else
        strContent.insert(idx,'5');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num6_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'^');
    else
        strContent.insert(idx,'6');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num7_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'&');
    else
        strContent.insert(idx,'7');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num8_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'*');
    else
        strContent.insert(idx,'8');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num9_L_parenthesis_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'(');
    else
        strContent.insert(idx,'9');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_num0_R_parenthesis_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,')');
    else
        strContent.insert(idx,'0');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_henggang_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'_');
    else
        strContent.insert(idx,'-');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_denghao_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'+');
    else
        strContent.insert(idx,'=');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_back_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(idx == 0)
    {
        m_lineEdit->setCursorPosition(idx);
        m_lineEdit->setFocus();
        return;
    }
    strContent.remove(idx-1,1);
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx-1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_left_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(idx == 0)
    {
        m_lineEdit->setCursorPosition(idx);
        m_lineEdit->setFocus();
        return;
    }
    m_lineEdit->setCursorPosition(idx-1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_right_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(idx == strContent.length()) //返回此字符串的字符数
    {
        m_lineEdit->setCursorPosition(idx);
        m_lineEdit->setFocus();
        return;
    }
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_q_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'Q');
    else
        strContent.insert(idx,'q');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_w_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'W');
    else
        strContent.insert(idx,'w');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_e_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'E');
    else
        strContent.insert(idx,'e');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_r_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'R');
    else
        strContent.insert(idx,'r');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_t_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'T');
    else
        strContent.insert(idx,'t');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_y_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'Y');
    else
        strContent.insert(idx,'y');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_u_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'U');
    else
        strContent.insert(idx,'u');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_i_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'I');
    else
        strContent.insert(idx,'i');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_o_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'O');
    else
        strContent.insert(idx,'o');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_p_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'P');
    else
        strContent.insert(idx,'p');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_L_brackets_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'{');
    else
        strContent.insert(idx,'[');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_R_brackets_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'}');
    else
        strContent.insert(idx,']');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_slash_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'|');
    else
        strContent.insert(idx,'\\');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_a_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'A');
    else
        strContent.insert(idx,'a');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_s_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'S');
    else
        strContent.insert(idx,'s');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_d_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'D');
    else
        strContent.insert(idx,'d');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_f_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'F');
    else
        strContent.insert(idx,'f');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_g_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'G');
    else
        strContent.insert(idx,'g');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_h_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'H');
    else
        strContent.insert(idx,'h');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_j_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'J');
    else
        strContent.insert(idx,'j');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_k_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'K');
    else
        strContent.insert(idx,'k');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_l_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'L');
    else
        strContent.insert(idx,'l');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_colon_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,':');
    else
        strContent.insert(idx,';');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_quotation_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'"');
    else
        strContent.insert(idx,'\'');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_enter_clicked()
{
    qDebug()<<"destroy";
    this->destroy();
    //    this->close();
}


void keyboardDialog::on_pushButton_z_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'Z');
    else
        strContent.insert(idx,'z');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_x_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'X');
    else
        strContent.insert(idx,'x');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_c_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'C');
    else
        strContent.insert(idx,'c');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_v_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'V');
    else
        strContent.insert(idx,'v');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_b_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'B');
    else
        strContent.insert(idx,'b');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_n_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'N');
    else
        strContent.insert(idx,'n');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_m_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'M');
    else
        strContent.insert(idx,'m');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_comma_L_quotes_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'<');
    else
        strContent.insert(idx,',');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_dot_R_quotes_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'>');
    else
        strContent.insert(idx,'.');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_back_slash_clicked()
{
    int idx = m_lineEdit->cursorPosition();
    if(m_shift_enable)
        strContent.insert(idx,'?');
    else
        strContent.insert(idx,'/');
    m_lineEdit->setText(strContent);
    m_lineEdit->setCursorPosition(idx+1);
    m_lineEdit->setFocus();
}


void keyboardDialog::on_pushButton_pie_clicked()
{
    int idx = m_lineEdit->cursorPosition();
     if(m_shift_enable)
         strContent.insert(idx,'~');
     else
         strContent.insert(idx,'`');
     m_lineEdit->setText(strContent);
     m_lineEdit->setCursorPosition(idx+1);
     m_lineEdit->setFocus();

}

